package com.js.domian.model.bot.analysis.message;

import cn.hutool.json.JSONUtil;
import com.js.domian.model.bot.analysis.Message;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TextMessage implements Message {

    private String text;

    @Override
    public String toString() {
        return text;
    }

    @Override
    public String toMessageString() {
        return String.format("{\"type\":\"%s\",\"data\":%s}", "text", JSONUtil.toJsonStr(this));
    }
}
